package cn.edu.scau.cmi.mingjunhui.composite.consistent;

import java.util.HashSet;
import java.util.Set;

public abstract class ConsistentComponent {
	public ConsistentComponent parent = null;
	public Set<ConsistentComponent> son=new HashSet<ConsistentComponent>();

	public String name;
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	
	public ConsistentComponent(ConsistentComponent org, String _name)
	{
		parent = org;
		this.name = _name;
	}
	
	public ConsistentComponent getParent()
	{
		return parent;
	}
	
	public abstract ConsistentComponent addChild(ConsistentComponent child);
	public abstract Set<ConsistentComponent> getChild();
	public abstract ConsistentComponent deleteChild(ConsistentComponent child);
	public abstract String toString(int pos);
	public abstract ConsistentComponent get(String tarName);
	public abstract void setParent(ConsistentComponent p);
 
}
